package com.lc.qianrenshiye.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.TextView;

import com.lc.qianrenshiye.R;
import com.zcx.helper.pager.CarouselGroup;
import com.zcx.helper.scale.ScaleScreenHelperFactory;

import java.util.List;

/**
 * Created by Administrator on 2016/12/12.
 */
public class MyTabView extends CarouselGroup<String> {

    private LayoutInflater layoutInflater;

    public MyTabView(Context context, AttributeSet attrs) {
        super(context, attrs);

        layoutInflater = LayoutInflater.from(context);

    }

    @Override
    protected int getNum() {
        return 4;
    }

    @Override
    protected GridView getPager(GridView gridView) {
        return gridView;
    }

    @Override
    protected View getView(int i, String s) {

        View view = ScaleScreenHelperFactory.getInstance().loadView((ViewGroup) layoutInflater.inflate(R.layout.item_home_tab, null));

        TextView textView = (TextView) view.findViewById(R.id.item_tab_tv);

        textView.setText(s);

        return view;
    }
}
